var calenderUtils={
    getToDay:function (){
        const today = new Date();
        return today;
    },
    createDate:function(year, month, day) {
        return new Date(year, month , day);
    },
    formatDate:function (date){
        const year = date.getFullYear();
        const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始，需要+1
        const day = String(date.getDate()).padStart(2, '0');
        return `${year}-${month}-${day}`;
    },
    //获取当月有多少天
    getDaysInMonth:function (year, month){
        // 注意：月份是从0开始的（0=一月，11=十二月）
        return new Date(year, month + 1, 0).getDate();
    },
    //获取是星期几啦
    getWeekday:function(year, month, day){
        // 注意：月份是从0开始的（0=一月，11=十二月）
        const date = new Date(year, month , day);
        const dayOfWeek = date.getDay(); // 返回0-6（0=星期日，6=星期六）
        return dayOfWeek;
    },
    //将日期往前推一个月
    subtractOneMonth:function (date){
        const newDate = new Date(date); // 创建副本以避免修改原日期
        const originalDate = newDate.getDate();

        // 先将日期设置为1号，避免月末问题
        newDate.setDate(1);
        // 月份减1
        newDate.setMonth(newDate.getMonth() - 1);

        // 获取上个月的最后一天
        const lastDayOfPrevMonth = new Date(
            newDate.getFullYear(),
            newDate.getMonth() + 1,
            0
        ).getDate();

        // 恢复原始日期，但不能超过上个月的最后一天
        newDate.setDate(Math.min(originalDate, lastDayOfPrevMonth));

        return newDate;
    },
    //js将date往前推一年
    safeSubtractOneYear:function (date){
        const newDate = new Date(date);
        const originalYear = newDate.getFullYear();
        const originalMonth = newDate.getMonth();
        const originalDay = newDate.getDate();

        // 如果是2月29日且前一年不是闰年，调整为2月28日
        if (originalMonth === 1 && originalDay === 29 &&
            !this.isLeapYear(originalYear - 1)) {
            newDate.setDate(28);
        }

        newDate.setFullYear(originalYear - 1);
        return newDate;
    },
    isLeapYear:function (year){
        return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0);
    },
    //往后推一个月
    safeAddOneMonth(date){
        const newDate = new Date(date);
        const originalDate = newDate.getDate();

        // 先将日期设置为1号，避免月末问题
        newDate.setDate(1);
        // 月份加1
        newDate.setMonth(newDate.getMonth() + 1);

        // 获取下个月的最后一天
        const lastDayOfNextMonth = new Date(
            newDate.getFullYear(),
            newDate.getMonth() + 1,
            0
        ).getDate();

        // 恢复原始日期，但不能超过下个月的最后一天
        newDate.setDate(Math.min(originalDate, lastDayOfNextMonth));

        return newDate;
    },
    //往后推一年
    safeAddOneYear:function (date){
        const newDate = new Date(date);
        const originalYear = newDate.getFullYear();
        const originalMonth = newDate.getMonth();
        const originalDay = newDate.getDate();

        // 如果是2月29日且下一年不是闰年，调整为2月28日
        if (originalMonth === 1 && originalDay === 29 &&
            !this.isLeapYear(originalYear + 1)) {
            newDate.setDate(28);
        }

        newDate.setFullYear(originalYear + 1);
        return newDate;
    }
}
var form={
    formEle:{},
    radioCls:".radio_form",
    inputCls:".input_form",
    selectCls:".select_form",
    calenderCLs:".calender_form",
    init:function (){
        this.initRadio();
        this.initInput();
        this.initSelect();
        this.initCalender();
    },
    initCalender:function (){
        let calenderList=document.querySelectorAll(this.calenderCLs);
        if(calenderList && calenderList.length>0){
            for (let i = 0; i < calenderList.length ; i++) {
                let dom=calenderList[i];
                let calender=this.createCalender(dom);
                dom.replaceWith(calender);
            }
        }
    },
    createCalender:function (dom){
        let label_=dom.getAttribute("f_label");
        let input=document.createElement("INPUT");
        let calender=document.createElement("DIV");
        calender.classList.add("form_item");
        input.classList.add("input_form");
        input.setAttribute("readonly","readonly");
        if(label_){
            let label=this.createLabel(label_);
            calender.appendChild(label);
        }
        let calenderBox=document.createElement("DIV");
        calenderBox.classList.add("calender_box");
        //创建箭头
        let arrow=this.createArrow();
        arrow.classList.add("input_arrow");
        calenderBox.appendChild(input);
        calenderBox.appendChild(arrow);
        let pane=document.createElement("DIV");
        input.addEventListener("click",(e)=>{
            arrow.classList.add("rotate_180");
            pane.style.display="flex";
        })
        document.addEventListener("click",(e)=>{
            if(!input.contains(e.target) && !pane.contains(e.target)){
                arrow.classList.remove("rotate_180");
                pane.style.display="none";
            }
        })
        pane.classList.add("calender_pane");
        pane.style.display="none";
        let date=calenderUtils.getToDay();
        let model={
            year:date.getFullYear(),
            month:date.getMonth(),
            day:date.getDate(),
            date:date,
            input_ele:input,
            pane_ele:pane,
        };
        let toolPane=document.createElement("DIV");
        toolPane.classList.add("tool_pane");
        let lastYearTool=this.createRightDoubleArrow("last_year");
        let lastMonthTool=this.createLeftArrow("last_month");
        let year=document.createElement("DIV");
        year.classList.add("year");
        year.textContent=model.year+" 年";
        let month=document.createElement("DIV");
        month.classList.add("month");
        month.textContent=(model.month + 1)+" 月";
        let nextYearTool=this.createRightDoubleArrow("next_year");
        let nextMonthTool=this.createLeftArrow("next_month");
        toolPane.appendChild(lastYearTool);
        toolPane.appendChild(lastMonthTool);
        toolPane.appendChild(year);
        toolPane.appendChild(month);
        toolPane.appendChild(nextMonthTool);
        toolPane.appendChild(nextYearTool);
        pane.appendChild(toolPane);
        let box=document.createElement("DIV");
        let table=this.dealCalenderBody(model);

        let this_=this;
        function dealCommon(model){
            let t=this_.dealCalenderBody(model);
            box.innerHTML="";
            let date=model.date;
            year.textContent=date.getFullYear()+" 年";
            month.textContent=(date.getMonth() + 1)+" 月";
            box.appendChild(t);
        }
        //上一年
        lastYearTool.addEventListener("click",(e)=>{
            model.date=calenderUtils.safeSubtractOneYear(model.date);
            dealCommon(model);
        })
        //上个月
        lastMonthTool.addEventListener("click",(e)=>{
            model.date=calenderUtils.subtractOneMonth(model.date);
            dealCommon(model);
        })
        //下个月
        nextMonthTool.addEventListener("click",(e)=>{
            model.date=calenderUtils.safeAddOneMonth(model.date);
            dealCommon(model);
        })
        //下一年
        nextYearTool.addEventListener("click",(e)=>{
            model.date=calenderUtils.safeAddOneYear(model.date);
            dealCommon(model);
        })
        box.classList.add("c_box");
        box.appendChild(table);
        pane.appendChild(box);
        calenderBox.appendChild(pane);
        calender.appendChild(calenderBox);
        return calender;
    },
    dealCalenderBody:function (model){
        let date=model.date;
        let totalDays=calenderUtils.getDaysInMonth(date.getFullYear(),date.getMonth());
        let week=calenderUtils.getWeekday(date.getFullYear(),date.getMonth(),1);
        let calenderArr=[];
        let arr=[];
        let nSpane=week+1;
        let index=1;
        let last_base= model.month-1;
        let lastMonth=null;
        let lastYear=model.year;
        if(last_base<0){
            lastMonth=11;
            lastYear--;
        }else {
            lastMonth=last_base;
        }
        let next_base=model.month+1;
        let nextYear=model.year;
        let nextMonth=null;
        if(next_base>11){
            nextMonth=0;
            nextYear++;
        }else {
            nextMonth=next_base;
        }
        //获取上个月有多少天
        let lastTotalDays=calenderUtils.getDaysInMonth(lastYear,lastMonth);
        //获取下个月总天数
        let nextTotalDays=calenderUtils.getDaysInMonth(nextYear,nextMonth);
        //上个月开始天数
        let lastIndex=lastTotalDays - nSpane;
        //下个月开始天数
        let nextIndex=1;
        //总共有6行,每行7天,所以日历方针是6*7,因为从1开始，所以是43;
        for (let i = 1; i < 43; i++) {
            let obj={};
            if(i>=nSpane){
                if(index>totalDays){
                    //后面一段空的日期
                    obj.type="next";
                    obj.text=nextIndex;
                    obj.day=nextIndex;
                    obj.year=nextYear;
                    obj.month=nextMonth;
                    obj.selected=false;
                    obj.date=calenderUtils.createDate(nextYear,nextMonth,nextIndex);
                    obj.dateStr=calenderUtils.formatDate(obj.date);
                    arr.push(obj);
                    nextIndex++;
                }else {
                    obj.type="curr";
                    obj.text=index;
                    obj.day=index;
                    obj.year=date.getFullYear();
                    obj.month=date.getMonth();
                    obj.date=calenderUtils.createDate(date.getFullYear(),date.getMonth(),index);
                    obj.dateStr=calenderUtils.formatDate(obj.date);
                    if(index===date.getDate()){
                        obj.selected=true;
                    }else {
                        obj.selected=false;
                    }
                    arr.push(obj);
                    index++;
                }
            }else {
                obj.type="last";
                obj.text=lastIndex;
                obj.day=lastIndex;
                obj.year=lastYear;
                obj.month=lastMonth;
                obj.date=calenderUtils.createDate(lastYear,lastMonth,lastIndex);
                obj.dateStr=calenderUtils.formatDate(obj.date);
                obj.selected=false;
                //前面一段空的日期
                arr.push(obj);
                lastIndex++;
            }
            if(i % 7===0){
                calenderArr.push(arr);
                arr=[];
            }
        }
        let weekArr=['日','一','二','三','四','五','六'];
        let calenderBody=null;
        let table=document.createElement("TABLE");
        table.classList.add("calender_table")
        let tbody=document.createElement("TBODY");
        let th_t=document.createElement("TR");
        th_t.classList.add("c_thead")
        for (let i = 0; i < weekArr.length ; i++) {
            let th=document.createElement("TH");
            th.textContent=weekArr[i];
            th_t.appendChild(th);
        }
        tbody.appendChild(th_t);
        for (let i = 0; i < calenderArr.length ; i++) {
            let tr=document.createElement("TR");
            let days=calenderArr[i];
            for (let j = 0; j < days.length ; j++) {
                let obj=days[j];
                let td=document.createElement("TD");
                if(obj.type!=='curr'){
                    td.classList.add("n");
                }
                if(obj.selected){
                    td.classList.add("current_day");
                }else {
                    td.classList.add("day")
                }
                td.setAttribute("date_str",obj.dateStr);
                td.addEventListener("click",(e)=>{
                    model.input_ele.value=obj.dateStr;
                })
                td.textContent=obj.text;
                tr.appendChild(td);
            }
            tbody.appendChild(tr);
        }
        table.appendChild(tbody);
        return table;
    },
    initSelect:function (){
        let selectList=document.querySelectorAll(this.selectCls);
        if(selectList && selectList.length>0){
            for (let i = 0; i < selectList.length ; i++) {
                let dom=selectList[i];
                let select=this.createSelect(dom);
                dom.replaceWith(select);
            }
        }
    },
    createSelect:function (dom){
        let f_name_=dom.getAttribute("f_name");
        let f_label_=dom.getAttribute("f_label");
        let placeholder_=dom.getAttribute("f_placeholder");
        let select=document.createElement("DIV");
        select.classList.add("form_item");
        if(f_label_){
            let label=this.createLabel(f_label_);
            select.appendChild(label);
        }
        let selectBox=document.createElement("DIV");
        let input=document.createElement("INPUT");
        input.classList.add("input_form");
        input.setAttribute("readonly","readonly")
        if(placeholder_){
            input.setAttribute("placeholder",placeholder_);
        }
        selectBox.classList.add("select_box");
        selectBox.appendChild(input);
        //创建箭头
        let arrow=this.createArrow();
        arrow.classList.add("input_arrow");
        selectBox.appendChild(arrow);
        let pane=document.createElement("DIV");
        input.addEventListener("focus",(e)=>{
            pane.style.display="block";
            arrow.classList.add("rotate_180");
        })
        document.addEventListener("click",(e)=>{
            if(!pane.contains(e.target) && !input.contains(e.target)){
                pane.style.display="none";
                arrow.classList.remove("rotate_180");
            }
        })
        pane.style.display="none";
        pane.classList.add("select_pane");
        let items=dom.querySelectorAll(".item");
        let itemNodes=[];
        for (let i = 0; i < items.length ; i++) {
            let item=items[i];
            let label_str=item.getAttribute("f_label");
            let value_str=item.getAttribute("f_value");
            let item_dom=document.createElement("DIV");
            item_dom.textContent=label_str;
            item_dom.setAttribute("f_value",value_str);
            item_dom.classList.add("item");
            item_dom.addEventListener("click",(e)=>{
                itemNodes.forEach((e)=>{
                    e.classList.remove("active");
                })
                item_dom.classList.add("active");
                arrow.classList.remove("rotate_180");
                pane.style.display="none";
                input.value=label_str;
            })
            itemNodes.push(item_dom);
            pane.appendChild(item_dom);
        }
        selectBox.appendChild(pane);
        select.appendChild(selectBox);
        return select;
    },
    initRadio:function (){
        let radioList=document.querySelectorAll(this.radioCls);
        if(radioList && radioList.length>0){
            for (let i = 0; i < radioList.length ; i++) {
                let dom=radioList[i];
                let radio=this.createRadio(dom);
                dom.replaceWith(radio);
            }
        }
    },
    createRadio:function (dom){
        let f_name_=dom.getAttribute("f_name");
        let f_label_=dom.getAttribute("f_label");
        let radio=document.createElement("DIV");
        radio.classList.add("form_item");
        if(f_label_){
            let label=this.createLabel(f_label_);
            radio.appendChild(label);
        }
        let radio_xz=document.createElement("A");
        let radio_wxz=document.createElement("A");
        radio_xz.style.width="16px"
        radio_xz.style.height="16px";
        radio_xz.style.display="none"
        radio_xz.addEventListener("click",(e)=>{
            radio_xz.style.display="none";
            radio_wxz.style.display="block";
            if(f_name_){
                this.formEle[f_name_]= false;
            }
        })
        radio_wxz.addEventListener("click",(e)=>{
            radio_wxz.style.display="none";
            radio_xz.style.display="block";
            if(f_name_){
                this.formEle[f_name_]= true;
            }
        })
        radio_wxz.style.width="16px"
        radio_wxz.style.height="16px";
        radio_wxz.style.display="block"
        let xz_str="<svg fill='#ff8200'  t=\"1743414575307\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"7423\" width=\"16\" height=\"16\"><path d=\"M196.923077 0h630.153846a196.923077 196.923077 0 0 1 196.923077 196.923077v630.153846a196.923077 196.923077 0 0 1-196.923077 196.923077H196.923077a196.923077 196.923077 0 0 1-196.923077-196.923077V196.923077a196.923077 196.923077 0 0 1 196.923077-196.923077z m0 78.769231a118.153846 118.153846 0 0 0-118.153846 118.153846v630.153846a118.153846 118.153846 0 0 0 118.153846 118.153846h630.153846a118.153846 118.153846 0 0 0 118.153846-118.153846V196.923077a118.153846 118.153846 0 0 0-118.153846-118.153846H196.923077z m584.900923 258.205538a36.509538 36.509538 0 0 1 1.260308 51.633231l-299.480616 313.107692c-0.118154 0.157538-0.393846 0.236308-0.630154 0.472616l-0.393846 0.551384c-2.166154 2.126769-4.726154 3.229538-7.207384 4.726154-1.575385 0.866462-2.796308 2.166154-4.411077 2.835692a35.800615 35.800615 0 0 1-27.490462 0.07877c-1.260308-0.512-2.284308-1.614769-3.544615-2.284308-2.756923-1.457231-5.592615-2.835692-8.034462-5.12-0.196923-0.157538-0.275692-0.433231-0.512-0.669538-0.196923-0.118154-0.393846-0.196923-0.551384-0.354462l-150.843077-156.593231a36.430769 36.430769 0 0 1 0.945231-51.633231 36.391385 36.391385 0 0 1 51.63323 0.945231l124.455385 129.102769 273.092923-285.61723a36.548923 36.548923 0 0 1 51.712-1.181539z\" p-id=\"7424\"></path></svg>";
        let wxz_str="<svg fill='#dcdfe6' t=\"1743414609725\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"7681\" width=\"16\" height=\"16\"><path d=\"M196.923077 78.769231a118.153846 118.153846 0 0 0-118.153846 118.153846v630.153846a118.153846 118.153846 0 0 0 118.153846 118.153846h630.153846a118.153846 118.153846 0 0 0 118.153846-118.153846V196.923077a118.153846 118.153846 0 0 0-118.153846-118.153846H196.923077z m0-78.769231h630.153846a196.923077 196.923077 0 0 1 196.923077 196.923077v630.153846a196.923077 196.923077 0 0 1-196.923077 196.923077H196.923077a196.923077 196.923077 0 0 1-196.923077-196.923077V196.923077a196.923077 196.923077 0 0 1 196.923077-196.923077z\" p-id=\"7682\"></path></svg>";
        const range = document.createRange();
        const fragment_xz = range.createContextualFragment(xz_str);
        const fragment_wxz=range.createContextualFragment(wxz_str);
        radio_xz.appendChild(fragment_xz);
        radio_wxz.appendChild(fragment_wxz);
        radio.appendChild(radio_xz);
        radio.appendChild(radio_wxz);
        let span=document.createElement("SPAN");
        span.style.marginLeft="5px"
        span.textContent=dom.textContent;
        span.style.userSelect="none"
        radio.appendChild(span);
        return radio;
    },
    initInput:function (){
        let inputList=document.querySelectorAll(this.inputCls);
        if(inputList && inputList.length>0){
            for (let i = 0; i < inputList.length ; i++) {
                let dom=inputList[i];
                let input=this.createInput(dom);
                dom.replaceWith(input);
            }
        }
    },
    createInput:function (dom){
        let f_name_=dom.getAttribute("f_name");
        let f_clear_=dom.getAttribute("f_clear");
        let placeholder_=dom.getAttribute("f_placeholder");
        let f_required_=dom.getAttribute("f_required");
        let label_=dom.getAttribute("f_label");
        let f_weight_=dom.getAttribute("f_weight");
        let div=document.createElement("DIV");
        let input=document.createElement("INPUT");
        let inputDiv=document.createElement("DIV");
        let tip=document.createElement("A");
        inputDiv.classList.add("input_box");
        inputDiv.appendChild(input);
        div.classList.add("form_item");
        tip.classList.add("tip");
        if(f_clear_){
            let divBox=document.createElement("DIV");
            divBox.classList.add("clear");
            divBox.style.width="16px";
            divBox.style.height="16px";
            divBox.style.padding="0px";
            let clearStr="<svg t=\"1743500673448\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"12281\" width=\"16\" height=\"16\"><path d=\"M513.835 64.223c-246.752 0-446.826 200.074-446.826 446.826s200.074 446.826 446.826 446.826S960.661 757.801 960.661 511.05 760.686 64.223 513.835 64.223z m197.481 584.964c16.357 16.357 16.556 42.788 0.1 59.344-16.357 16.357-42.788 16.457-59.344-0.1L513.835 570.294 375.697 708.431c-16.357 16.357-42.788 16.557-59.344 0.1-16.357-16.357-16.457-42.788 0.1-59.344L454.59 511.05 316.453 372.813c-16.357-16.357-16.557-42.788-0.1-59.344 16.357-16.357 42.788-16.457 59.344 0.1l138.137 138.137 138.137-138.137c16.357-16.357 42.787-16.556 59.344-0.1 16.357 16.357 16.457 42.788-0.1 59.344L573.079 511.05l138.237 138.137z\" p-id=\"12282\"></path></svg>";
            const range = document.createRange();
            const fragment = range.createContextualFragment(clearStr);
            divBox.appendChild(fragment);
            inputDiv.appendChild(divBox);
            divBox.style.display="none";
            divBox.addEventListener("click",(e)=>{
                input.value="";
                divBox.style.display="none";
            });
            input.addEventListener("input",(e)=>{
                let v=input.value;
                if(v){
                    divBox.style.display="block";
                }else{
                    divBox.style.display="none";
                }
            })
        }
        if(f_name_){
            let obj=this.createBindObj(input,"type");
            this.formEle[f_name_]= obj;
            input.addEventListener("input",(v)=>{
                let obj=this.formEle[f_name_];
                obj.value= input.value;
            })
        }
        if(placeholder_){
            input.setAttribute("placeholder",placeholder_);
        }
        if(label_){
            let label=this.createLabel(label_)
            div.appendChild(label);
        }
        input.style.width="inherit";
        if(f_weight_){

        }
        if(f_required_){
            input.addEventListener("blur",function (e){
                if(!input.value){
                    input.classList.add("err_tip");
                    tip.textContent=f_required_;
                    inputDiv.appendChild(tip);
                }else {
                    input.classList.remove("err_tip");
                    if(inputDiv.contains(tip)){
                        inputDiv.removeChild(tip);
                    }
                }
            })
        }
        input.classList.add("input_form");

        div.appendChild(inputDiv);
        return div;
    },
    createBindObj:function (dom,type){
        let obj={dom:dom,value:null,fn:null,type:type};
        const handler = {
            set(target, property, value) {
                console.log(`属性 ${property} 从 ${target[property]} 变更为 ${value}`);
                if(property==='value'){

                }
                target[property] = value;
                return true; // 表示设置成功
            }
        };
        return new Proxy(obj, handler);
    },
    createLabel:function (f_label_){
        let label=document.createElement("label");
        label.textContent=f_label_;
        label.style.marginRight="10px";
        label.style.fontSize="14px"
        label.style.color="#606266";
        label.style.width="80px";
        label.style.height="40px";
        label.style.userSelect="none";
        label.style.lineHeight="40px";
        label.style.textAlign="right";
        return label
    },
    //创建箭头
    createArrow:function (){
        let div=document.createElement("DIV");
        let str="<svg t=\"1743662778237\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"15280\" width=\"16\" height=\"16\"><path d=\"M209.922057 592.317257l38.498826 39.621393 277.219789-285.306978 277.223882 285.306978 38.497802-39.621393L525.640672 267.394003 209.922057 592.317257zM209.922057 592.317257\"  p-id=\"15281\"></path></svg>";
        const range = document.createRange();
        const fragment = range.createContextualFragment(str);
        div.appendChild(fragment);
        return div;
    },
    //创建向右双箭头
    createRightDoubleArrow:function (cls){
        let div=document.createElement("DIV");
        let str="<svg t=\"1743669231504\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"18008\" width=\"16\" height=\"16\"><path d=\"M456.529641 956.144566 412.608316 920.951019 740.398874 511.867994 412.479379 96.405677 456.658577 61.536518 812.308647 512.132006Z\" p-id=\"18009\"></path><path d=\"M261.078157 956.144566 217.156832 920.951019 544.94739 511.867994 217.027895 96.405677 261.207094 61.536518 616.857163 512.132006Z\" p-id=\"18010\"></path></svg>";
        const range = document.createRange();
        const fragment = range.createContextualFragment(str);
        div.appendChild(fragment);
        if(cls){
            div.classList.add(cls);
        }
        return div;
    },
    //创建左箭头
    createLeftArrow:function (cls){
        let div=document.createElement("DIV");
        let str="<svg t=\"1743669381630\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"18267\" width=\"16\" height=\"16\"><path d=\"M512.352457 90.073767a0.50086 0.50086 0 0 0-0.70589 0 0.499884 0.499884 0 1 0 0.70589 0z m0 0M741.034595 948.53221c-5.690082 5.68813-13.531031 8.949089-21.511596 8.951042-7.961038 0-15.789295-3.264865-21.479377-8.9569L282.984932 533.469613c-5.745733-5.73597-8.912965-13.35822-8.922729-21.468637-0.009763-8.10163 3.135013-15.712164 8.849503-21.426654L698.043622 75.396518c11.841971-11.841971 31.134357-11.838066 43.002689 0.007811 5.732065 5.732065 8.891486 13.368959 8.891486 21.501832 0 8.13092-3.159421 15.769768-8.897344 21.507691L347.463092 511.987308 741.0385 905.559787c11.843924 11.847829 11.843924 31.122641 0 42.966565l-0.003905 0.005858z\" p-id=\"18268\"></path></svg>";
        const range = document.createRange();
        const fragment = range.createContextualFragment(str);
        div.appendChild(fragment);
        if(cls){
            div.classList.add(cls);
        }
        return div;
    },
}